import request from '@/utils/request';

const articleBaseURL = '/article'

export function getArticleDetailById(params){
    return request({
        url: articleBaseURL+'/getArticleDetailById',
        method: 'get',
        params
    })
}

    /**
     * 前台展示文章详情
     * @param id
     * @return
     */
export function showArticleDetailById(params){
    return request({
        url: articleBaseURL+'/showArticleDetailById',
        method: 'get',
        params
    })
}

export function deleteArticleById(data){
    return request({
        url: articleBaseURL+'/deleteArticleById',
        method: 'post',
        data
    })
}

export function createArticle(data){
    return request({
        url: articleBaseURL+'/createArticle',
        method: 'post',
        data
    })
}

export function updateArticle(data){
    return request({
        url: articleBaseURL+'/updateArticle',
        method: 'post',
        data
    })
}

export function getArticlePage(params) {
    return request({
        url: articleBaseURL+'/getArticlePage',
        method: 'get',
        params
    })
}

export function getAllArticleData(params) {
    return request({
        url: articleBaseURL+'/getAllArticleData',
        method: 'get',
        params
    })
}

export function getArticleTotalCount(params) {
    return request({
        url: articleBaseURL+'/getArticleTotalCount',
        method: 'get',
        params
    })
}

export function getRandomArticleList(params){
    return request({
        url: articleBaseURL+'/getRandomArticleList',
        method:'get',
        params
    })
}


